package han.chensing.latos.game.elements.character.impl;

import han.chensing.latos.game.elements.character.Character;
import han.chensing.latos.game.elements.character.CharacterInstance;

public class TestCharacter extends Character {

    int dropPerSecond=50;

    public TestCharacter() {
        setMaxHealth(400);
    }

    @Override
    public void invokeTick(CharacterInstance characterInstance, float delta) {
        characterInstance.decreaseHealth(dropPerSecond*delta);
    }

    @Override
    public void invokeMessage(CharacterInstance characterInstance, String message) {
        switch (message){
            case "onPerfect":{
                dropPerSecond=Math.max(dropPerSecond-1,0);
                if (dropPerSecond==0)
                    characterInstance.increaseHealth(1);
                break;
            }
            case "onGood":
                break;
            case "onBad":
            case "onMiss":{
                characterInstance.decreaseHealth(5);
                dropPerSecond+=30;
                break;
            }
        }
    }

    @Override
    public boolean isDead(CharacterInstance characterInstance) {
        return false;
    }
}
